<div id="messageContainer">
	<p style="border-bottom:3px solid #000;padding-bottom:5px;font-weight:bold;">ALL INBOX</p>
	<?if($allinbox):?>
		
		<table class="table">
			<tr class="info">
				<td><span class="label label-inverse">Date:</span></td>
				<td><span class="label label-inverse">From:</span></td>
				<td><span class="label label-inverse">To:</span></td>
				<td><span class="label label-inverse">Title:</span></td>
				<td></td>
			</tr>
			<?foreach($allinbox as $k => $v):?>
				<?
					if($v['recipients']){
						foreach($v['recipients'] as $vv)
						{
							$recipients[$k][] = strtolower($vv->recipient);
						}

						if($recipients)
						{
							$f_rec = implode(', ',array_map('ucwords',$recipients[$k]));
						}else{
							$f_rec = 'None';
						}
					}else{
						$f_rec = 'None';
					}
				?>
				<tr>
					<td><?=$v['data']->msg_created;?></td>
					<td><?=ucwords(strtolower($v['data']->origin));?></td>
					<?php if(strpos($f_rec, ',') !== FALSE){ ?>
					<td><span data-tooltip class="has-tip" title="<?=$f_rec;?>">others</span></td>
					<?php }else{ ?>
					<td><span data-tooltip class="has-tip" ><?=$f_rec;?></span></td>
					<?php } ?>
					<td><?=$v['data']->title;?></td>
					<td>
						<div class="btn-group">
							<a href="<?=site_url('message/archivethread/'.__link($v['data']->id));?>" class="btn btn-mini" data-tooltip class="has-tip" title="View this Message Thread"><i class="icon-eye-open"></i></a>
						</div>
					</td>
				</tr>
			<?endforeach;?>
		</table>

	<?else:?>
		<div class="alert-box">No New Message</div>
	<?endif;?>
</div>